package query

import (
	"errors"
	"ssadmin/common/query"
)

type RegisterQuery struct {
	query.Pagination `search:"-"`
	Id               string `form:"id"  search:"type:exact;column:id;table:t_register"`
	Status           string `form:"status"  search:"type:exact;column:status;table:t_register"`
	UserName         string `form:"userName"  search:"type:exact;column:user_name;table:t_register"`
	Mobile           string `form:"mobile"  search:"type:exact;column:mobile;table:t_register"`
	Email            string `form:"email"  search:"type:exact;column:email;table:t_register"`
	Search           string `form:"search"  search:"type:contains;column:user_name;table:t_register"`
}

func (m *RegisterQuery) GetNeedSearch() interface{} {
	return *m
}
func (m *RegisterQuery) GetId() (id interface{}, err error) {
	if len(m.Id) == 0 {
		return nil, errors.New("ID不能为空")
	}
	return *m, nil
}
